package com.lb.trac.controller.propertyeditor;

import java.beans.PropertyEditorSupport;
import java.math.BigDecimal;

import com.lb.trac.pojo.Societa;

public class SocietaPropertyEditor extends PropertyEditorSupport {

	@Override
	public String getAsText() {
		Societa societa = (Societa) getValue();
		if (societa == null) {
			return "";
		}
		return "" + societa.getIdCliente();
	}

	@Override
	public void setAsText(String arg0) throws IllegalArgumentException {
		Societa s = new Societa();
		if (arg0 != null) {
			s.setIdCliente(new BigDecimal(arg0));
			setValue(s);
			System.out.println(getValue());
		}
	}

}
